#include "llcomp_llc.h"
#include <sys/time.h>
;
#include <stdio.h>
;
#include <stdlib.h>
;
#include <string.h>
;
 int llc_main(  int argc,  char **argv) 
{

      double   local;
      double   pi_seq = 0.0;
      double   w;
      struct timeval    start_time;
      struct timeval    end_time;
      double   exe_time_seq;
      long   i;
      long   N;
N= (((argc > 1))?atol(argv[1] ) :1000000000);
w= (1.0 / N);
gettimeofday  ((&start_time ),0   ) ;
  
{

pi_seq= 0.0;
    for (i= 0; (i < N); (i++ ))    
{

local= (((i + 0.5)) * w);
pi_seq= (pi_seq + ((4.0 / ((1.0 + ((local * local)))))));
    }

 ;
  }

;
gettimeofday  ((&end_time ),0   ) ;
exe_time_seq= (end_time.tv_sec  - start_time.tv_sec );
exe_time_seq= (exe_time_seq + ((((end_time.tv_usec  - start_time.tv_usec )) / 1e6)));
pi_seq*= w;
printf  ("%d:%f:%f\n",LLC_NAME,exe_time_seq,pi_seq   ) ;
  return 0;
}

;
 int main(  int argc,  char **argv) 
{

      int   llc_return_code = 0;
MPI_Init  ((&argc ),(&argv )   ) ;
MPI_Comm_rank  (MPI_COMM_WORLD,(int *)((&LLC_GLOBAL_NAME ))   ) ;
MPI_Comm_size  (MPI_COMM_WORLD,(int *)((&LLC_GLOBAL_NUMPROCESSORS ))   ) ;
LLC_NAME= LLC_GLOBAL_NAME;
LLC_NUMPROCESSORS= LLC_GLOBAL_NUMPROCESSORS;
llc_GlobalGroup= MPI_COMM_WORLD;
llc_CurrentGroup= (&llc_GlobalGroup );
llc_return_code= llc_main(argc,argv ) ;
MPI_Finalize  (   ) ;
  return llc_return_code;
}

;
